"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
from dao.base_dao import BaseDao
from orm_domain.execution import Execution


class ExecutionDao(BaseDao):

    def save(self, execution: Execution) -> None:
        return self.add(execution)

    def get(self, **filter_by):
        return self.query(Execution).filter_by(**filter_by).first()

    def get_list(self, **filter_by):
        return self.query(Execution).filter_by(**filter_by).all()

    def delete(self, execution: Execution):
        self.delete(execution)
